import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/pages/login/Login'
import Home from '@/pages/home/Home'
import LeaveMsg from '@/pages/home/polmsg/leaveMsg'
import WarnMsg from '@/pages/home/polmsg/WarnMsg'
import WarnAnalysis from '@/pages/home/dataanalysis/warnanalysis'
import Power from '@/pages/home/setsystem/Power'
import Index from '@/pages/home/index/Index'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: "/login"
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      children: [
        {
          path: 'index',
          component:Index,
          meta: { title: '系统首页' }
        },
        {
          // 坑不要在之前加leavemsg/
          path: 'leavemsg',
          component: LeaveMsg,
          meta: { title: '留言管理' }
        },
        {
          path: 'warnmsg',
          component: WarnMsg,
          meta: { title: '警务信息管理' }
        },
        {
          path: 'warnanalysis',
          component: WarnAnalysis,
          meta: { title: '警务数据分析' }
        },
        {
          path: 'power',
          component: Power,
          meta: { title: '权限管理' }
        }
      ]
    }
  ]
})
